package sung.myabst;

import java.util.ArrayList;

public abstract class AbsFindNumbers {
	
	int[] numberList = { 34, 26, 98, 76, 32, 15, 56, 24, 5, 7, 14 };
	
	public abstract void findNumberASC();
	public abstract void findNumberDESC();
	public abstract void findNumberHighest();
	public abstract void findNumberLowest();
	
	public ArrayList<Integer> findNumber(int userReqNO){
		int findNO = 999;
		int tempValue = 999;
		ArrayList<Integer> result = new ArrayList<Integer>();
		
		for (int i = 0; i < numberList.length; i++) {
			int checkVal = (numberList[i] - userReqNO < 0) ? -(numberList[i] - userReqNO): numberList[i] - userReqNO;
			if (checkVal <= tempValue) {
				result.add(numberList[i]);
				tempValue = checkVal;
			}
		}
		
		return result;
	}

}
